<?php
namespace Home\Controller;
use Think\Controller;

class IndexController extends Controller {
    //主页
    public function index(){

        $art=D('Home/art');
       
        
        //最新
         $art->field('img,title,art_id,update_time,type')
         ->where(['cat_id'=>1])->order('update_time desc,hot desc')->limit(10);

         $this->assign('new',$art->select());


        //预告
         $pp=$art->field('img,title,art_id,update_time,type')
         ->where('cat_id=5')->order('update_time desc')->limit(12)->select();         
         $this->assign('yugao',$pp);
         
        //电影
         $art->field('img,title,art_id,update_time,type')
         ->where('cat_id=1')->order('update_time desc')->limit(10);
         $this->assign('dy',$art->select());

        //电视剧
         $art->field('img,title,art_id,type,update_time,region')
         ->where('cat_id=2')->order('update_time desc')->limit(10);
         $this->assign('dsj',$art->select());

        //动漫 
         $art->field('img,title,art_id,update_time')->where('cat_id=3')->order('update_time desc')->limit(10);
         
         $this->assign('dm',$art->select());

        //综艺
         $art->field('img,title,art_id,update_time,type,region')->where('cat_id=4')->order('update_time desc')->limit(10);

         $this->assign('zy',$art->select());

         $this->display();



    }






}